package shuishijie.suishijie.model;



import java.util.List;

import shuishijie.suishijie.util.AppUtil;

/**
 * Created by mindx on 2017/8/29.
 */

public class BillList {

    /**
     * currentPage : 1
     * data : [{"addTime":1504342963000,"funds_status":"0","of_id":2,"price":300,"remark":"测试记录","type":"10"}]
     * totalPage : 1
     */

    public int currentPage;
    public int totalPage;
    public List<BillInfo> data;

    public static class BillInfo {
        /**
         * addTime : 1504342963000
         * funds_status : 0
         * of_id : 2
         * price : 300
         * remark : 测试记录
         * type : 10
         */

        public String addTime;
        public String funds_status;
        public String of_id;
        public double price;
        public String remark;

        /**
         * "10：购买商品
         * 11：成为店主
         * 12：成为商家
         * 13：管理奖
         * 14：余额支付
         * 15: 商品收益（赚）
         * 20: 抽成收益10%
         * 25: 退款，+
         * 26：退款到余额 +
         * 27：退款收益 -
         * 30：店主分享，（教育奖）
         * 35：大咖分享，
         * 40: 提现
         * 60：全球分红
         * 80：仓储费用
         * 说明：支付：10，11,14、退款：25，26,27、提现:40、收入：13，15,20,30,35，60, 80"
         */
        public String type;

        public String getTypeDesc() {
            String ret = "其他";
            int type = AppUtil.parseInt(this.type);
            if (type == 13 || type == 15 || type == 20 || type == 30 || type == 35 || type == 60 || type == 80) {
                ret = "收入";
            } else if (type == 25 || type == 26 || type == 27) {
                ret = "退款";
            } else if (type == 10 || type == 11 || type == 12 || type == 14) {
                ret = "支付";
            } else if (type == 40) {
                ret = "提现";
            } else if (type == 43) {
                ret = "提现成功";
            } else if (type == 47) {
                ret = "提现遭拒";
            } else if (type == 13) {
                ret = "管理奖";
            } else if (type == 60) {
                ret = "全球分红";
            }
            return ret;
        }
    }
}
